<extend name="Include:Layout"/>
<block name="title">输入验证码</block>
<block name="style">
<style>

</style>
</block>

<block name="main">
	<div class="weui_tab">
		<div class="weui_navbar">
			<div class="toolbar">
		        <div class="toolbar-inner">
		            <a href="javascript:history.go(-1);" class="picker-button close-popup">上一步</a>
		            <h1 class="title" id="banji_title">输入验证码</h1>
		        </div>
		    </div>
		</div>
		<div class="weui_tab_bd container" id="container">
			<div class="weui_cell" style="background:#fff;margin-top:20px;">
	            <div class="weui_cell_hd"><label class="weui_label">验证码</label></div>
	            <div class="weui_cell_bd weui_cell_primary">
	                <input class="weui_input" type="number" id="code" pattern="[0-9]*" placeholder="请输入验证码">
	            </div>
	        </div>
		    <div class="weui_btn_area">
		    	<input type="hidden" name="mobile" value="{$mobile}"/>
		        <a class="weui_btn weui_btn_primary btn_submit">下一步</a>
		    </div>
		</div>
	</div>
 
</block>

<block name="script">
<script>
$(".btn_submit").click(function(){
	var mobile = $('input[name=mobile]').val();
	var code = $("#code").val();
	if(code == ''){
		$.toast("请输入验证码");
		return false;
	}
	$.post('/api/api/marrysms',{mobile:mobile,code:code,type:'bangding'},function(ret){
		if(ret.status){
			$.toast(ret.info,"text", function() {
				location.href='/home/user/realname/mobile/'+mobile;
			});
		}else{
			$.toast(ret.info,"text");
		}
	});
})
</script>
</block>